<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>GO机网管理后台</title>
	<meta http-equiv="X-UA-Compatible" content="chrome=1,IE=edge">
	<link href="../../css/bootstrap.min.css" rel="stylesheet">
	<link href="css/nifty.min.css" rel="stylesheet">
	<link href="../../css/demo/nifty-demo-icons.min.css" rel="stylesheet">
	<link href="../../plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet">
	<link href="../../plugins/pace/pace.min.css" rel="stylesheet">
	<script src="../../plugins/pace/pace.min.js?2016/8/5"></script>
	<script src="../../js/jquery-2.2.1.min.js"></script>
	<style>
		table{
			margin:auto;
		}
		td{
			vertical-align: middle!important;
			padding:10px;
		}
		input{
			padding:5px;
			margin:5px;
		}
		.panel.active{
			border-color: #2ac845;
		}
		img{
			width:80px;
			height:80px;
		}
		.start span:first-child{
			width:5em;
			display:inline-block;
		}
		.price:after{
			content:"元";
		}
	</style>
</head>
<body id="main">
<div id="container" class="effect mainnav-lg">
	@@include('public/header.html')
	<div class="boxed">
		<div id="content-container">
			
			<div id="page-title" style="position: relative">
				<h1 class="page-header text-overflow">机友提成比例设置</h1>
			</div>
			<div id="page-content">
				<div class="col-sm-12 pad-btm pad-top" style="text-align:center;padding:50px 0;">
					<validator name="validation">
					<table>
						<tr>
							<td>一级机友提成比例</td>
							<td><input type="number" v-model="data.stair_value" v-validate:data.stair_value="{required: true}"/>%</td>
						</tr>
						<tr>
							<td>二级级机友提成比例</td>
							<td><input type="number"  v-model="data.second_value" v-validate:data.second_value="{required: true}"/>%</td>
						</tr>
						<tr>
							<td colspan="2">
								<button class="btn btn-primary" v-on:click="saveData();" :disabled="!$validation.valid">保存</button>
							</td>
						</tr>
					</table>
					</validator>
				</div>
			</div>
		</div>
		
		<nav id="mainnav-container">
			@@include('public/left_menu.html')
		</nav>
	</div>
</div>
@@include('public/footer.html')

<script src="../../plugins/vue/vue.min.js"></script>
<script src="js/vue-validator.min.js"></script>
<script src="../../js/base.js"></script>
<script>
	function formatDate(date_){
	    var d = new Date(date_*1000);
	    var dformat = [ d.getFullYear(), d.getMonth() + 1, d.getDate() ].join('-')
	        + ' ' + [ d.getHours(), d.getMinutes(), d.getSeconds() ].join(':');
	    return dformat;
	};
	
	var vue = new Vue({
		el:"#main",
		data:{
			data:{}
		},
		methods:{
			/*根据状态加载订单*/
			loadDatas:function(page){
				var thiz = this;
				$.post(apiRepair+'index.php?m=Home&c=Jy&a=getJYRatio',{},function(res){
					vue.data = res.data;
				},'json');
			},
			
			saveData:function(user){
				var index = layer.load(1, {shade: [0.5,'#555']});
				$.post(apiRepair+'index.php?m=Home&c=Jy&a=setJYRatio', vue.data, function(res){
					layer.close(index);
					vue.friends = res.data;
				},'json');
			}
		},
		ready:function(){
			this.loadDatas(1);
		}
	});
</script>
</body>
</html>
